/*Dataset Daily1 has 3,038 observations and 210 variables.
A few variables were not used in the reported study.

--TABLE 1 

SOCIODEMO 
Age group: Age  
Sex: PESex 
Race/Ethnicity: race_ethn4 race_ethn
Marital status: marstat  
Education level: educ3 
Employment status: empl 
Income: income 
U.S. Region: GEREG 
Metropolitan status: metro metro2 
Survey mode: Phone1 

TOBACCO USE BEHAVIOR
Indicator of Daily Smoking 12 Months Prior to The Assessment: smok12  
Number of Cigarettes Currently Smoked per Day: cigday  
Current use of E-Cigarettes: ecig_curr1 
Current Use of Nicotine Pouches: nicpouch_curr1

QUIT ATTEMPT HISTORY 
Number of Serious Quit Attempts: number4plus_1 (0=1-3 attempts, 1=4+ attempts)
Duration of the Last Serious Quit Attempt:days_7plus (0=1-6 days, 1=7+ days)

--TABLE 2 
All 0/1 indicators (unless stated otherwise): 0=No, 1=Yes

ATP and AID USE DURING QUIT ATTEMPT
Cigars and pipes filled with tobacco: cigars_pipes  
E-cigarettes: ecig  
Nicotine pouches: smokeless 
Smokeless tobacco: nicp 
NRT: NRT
Prescription pill: pill
Quitline: quitline  
Individual in-person counseling: counsel   
Group counseling or support group: classgr  
Digital tool or program: webapp 

--TABLE 3
Intend to Quit: quit6mo 
Interest in Quitting: quitscore
*/

/*RUN FORMATS*/
proc format;
value AgeGrpf 
	1="18-24" 
	2="25-44" 
	3="45-64" 
	4="65+";
value Agef 
	1="18-25" 
	2="26-44" 
	3="45-64" 
	4="65+";
value sexf 
	1='male' 
	2='female' ;
value race_ethnf 
	1='NH White' 
	2='NH BAA' 
	3='NH AIAN'
    4='NH Asian' 
	5='NH HPI' 
	6='NH Mult' 
	7='Hisp';
value race_ethn5f 
	1='NH White' 
	2='NH BAA'
	3='NH AIAN'
	4='NH OTHER:ASIAN,HPI,MULT' 
	7='Hisp' ;
value race_ethn4f 
	1='NH White' 
	2='NH BAA' 
	4='NH OTHER:AIAN,ASIAN,HPI,MULT' 
	7='Hisp' ;
value NewEDUf
    1='high school or less, no diploma'
    2='high school diploma'
    3='some college, no degree'
    4='associate degree'
    5='bachelor or higher';
Value EducF
	1 = "Less than High School"
	2 = "High School (or equivalent)"
	3 = "Some College or Bachelor�s Degree"
	4 = "Graduate degree";
Value Educ3F
	1 = "Below High School Diploma"
	2 = "High Sch Diploma/EQUIV"
	3 = "Some coll/BS or Grad degree";
value newemplstatf
    1='working/Employed-at work/With job, not at work/Employed-absent'
    2='Unemployed-on layoff/Unemployed-looking for work'
    3='Not in labor force';
value emplf
    1='working/Employed-at work/With job, not at work/Employed-absent'
    0='Unemployed/Not in labor force';
value incomef
    1='<$20,000'
    2='$20,000-39,999'
    3='$40,000-74,999'
    4='$75,000+';
value marriedF 
	1 = "Married (Spouse present or absent)"
	2 = "widowed, divorced, or separated"
	3 = "Never married";
value GEREGf
	1='Northeast'
	2='Midwest'
	3='South'
	4='West';
value phone1F
	1 = "Phone"
	2 = "Personal";
value metrof
    1='Metropolitan'
    2='Non-Metropolitan'
	3='Not identified';
value metro2f
    1='Metro'
    0='Non-Metro/Unknown';
Value SmokStatF
	1 = "Never"
	2 = "Everyday"
	3 = "Some days"
	4 = "Former";
Value nicpouch_currF
	1 = "Daily"
	2 = "Some days"
	3 = "Not at all";
Value smok12F
	1 = "Daily"
	0 = "Some days/Not at all";
Value cigdayf
    0='<10'
    1='>=10'  ;
Value yesnof
	1='Yes'
	2='No';
run;
/*Assign name to the library (folder) where the dataset Daily1 is stored
e.g., LibName Sh "C:\Desktop";*/

data daily1; set Sh.daily1;run;

/*Table 1*/
Proc SurveyFreq Data=daily1 VarMethod=BRR (Fay=0.5);
Tables Age PESex race_ethn4 race_ethn marstat educ3  EMPL  /*NewEMPLSTAT*/
income metro2 metro GEREG  Phone1/row;
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;
Run;  
Proc SurveyFreq Data=daily1 VarMethod=BRR (Fay=0.5);
Tables  smok12  cigday ecig_curr1 nicpouch_curr1
number4plus_1 days_7plus /row;
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;
Run;  

/*Sect 3.1*/
Proc SurveyFreq Data=daily1 VarMethod=BRR (Fay=0.5);
Tables ecig nicp  smokeless  cigars_pipes/row ;
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;
Run;  
Proc SurveyFreq Data=daily1 VarMethod=BRR (Fay=0.5);
Tables NRT pill  quitline counsel  classgr   webapp  /row;
 Weight PWSRWgt; RepWeights RepWgt1-RepWgt160; Run;  
/*mentioned in the the text*/
Proc SurveyFreq Data=daily1 VarMethod=BRR (Fay=0.5);
Tables NRT*(pill quitline counsel classgr webapp);
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160; Run;  


/*TABLE 2 Chi-Square tests*/
Proc SurveyFreq Data=daily1 VarMethod=BRR (Fay=0.5);
Tables (cigars_pipes nicp smokeless NRT pill quitline counsel classgr  webapp)*ecig /row chisq; 
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run;  
Proc SurveyFreq Data=daily1 VarMethod=BRR (Fay=0.5);
Tables (cigars_pipes ecig  smokeless NRT  pill quitline counsel classgr webapp)*nicp /row chisq;
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run;  


/*Sect 3.2 Models*/
/*FINAL MODEL: ECIG*/
PROC SURVEYLOGISTIC data=daily1 VarMethod=BRR(Fay=0.5); 
class Age PESex(REF=FIRST) race_ethn4 educ3(REF=LAST) empl(REF=FIRST) marstat(REF="Never married") income(REF="$75,000+")  metro2(REF=FIRST) GEREG  
smok12(REF=FIRST) NRT(REF=FIRST)  pill(REF=FIRST)   quitline(REF=FIRST) counsel(REF=FIRST)  classgr(REF=FIRST)  webapp(REF=FIRST)  nicp(REF=FIRST) smokeless(REF=FIRST)   cigars_pipes(REF=FIRST)  ;
model ecig(REF=FIRST)=cigars_pipes nicp  smokeless   
  	                  NRT pill quitline counsel classgr webapp  
	                  smok12
                      Age PESex race_ethn4 marstat educ3 EMPL income metro2 GEREG /GCONV=1E-12  rsquare ;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
/*BONF for age and race/ethnicity*/
PROC SURVEYLOGISTIC data=daily1 VarMethod=BRR(Fay=0.5); 
class Age PESex(REF=FIRST) race_ethn4 educ3(REF=LAST) empl(REF=FIRST)
income(REF="$75,000+") marstat(REF="Never married") metro2(REF=FIRST) GEREG smok12(REF=FIRST) NRT(REF=FIRST)  pill(REF=FIRST)   quitline(REF=FIRST)   
counsel(REF=FIRST)  classgr(REF=FIRST)  webapp(REF=FIRST)  nicp(REF=FIRST) smokeless(REF=FIRST)   cigars_pipes(REF=FIRST)  ;

model ecig(REF=FIRST)=smok12  NRT pill quitline counsel classgr webapp  
		              nicp  smokeless   cigars_pipes
                      Age PESex race_ethn4 educ3 EMPL income marstat metro2 GEREG 
/alpha=0.0167 GCONV=1E-12  rsquare ;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
/*FINAL MODEL: nicp */
PROC SURVEYLOGISTIC data=daily1 VarMethod=BRR(Fay=0.5); 
class Age PESex(REF=FIRST) race_ethn4 educ3(REF=LAST) empl(REF=FIRST) income(REF="$75,000+") marstat(REF="Never married") metro2(REF=FIRST) GEREG   
smok12(REF=FIRST) NRT(REF=FIRST)  pill(REF=FIRST)   quitline(REF=FIRST)   
counsel(REF=FIRST)  classgr(REF=FIRST)  webapp(REF=FIRST)  ecig(REF=FIRST)  smokeless(REF=FIRST)   cigars_pipes(REF=FIRST)  ;
model nicp(REF=FIRST)=cigars_pipes ecig  smokeless
		              NRT pill quitline counsel classgr webapp  
                      Age PESex race_ethn4 marstat educ3 EMPL income  metro2 GEREG 
                      smok12 /GCONV=1E-12  rsquare ; 
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 

/*Sect 3.3 and Table 3*/
Proc SurveyFreq Data=daily1 VarMethod=BRR (Fay=0.5);
Tables quit6mo /row ;Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run;  
PROC SURVEYMEANS data=daily1 min max mean median VarMethod=BRR(Fay=0.5); 
var quitscore ;  Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
Proc SurveyFreq Data=daily1 VarMethod=BRR (Fay=0.5);
Tables  (cigars_pipes ecig nicp smokeless 
         NRT pill quitline counsel classgr webapp)*quit6mo/row chisq;
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run;  

PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class cigars_pipes; model quitscore=cigars_pipes ;  
lsmeans cigars_pipes / cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class ecig; model quitscore=ecig ;  
lsmeans ecig / cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class nicp; model quitscore=nicp ;  
lsmeans nicp / cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class smokeless; model quitscore=smokeless ;  
lsmeans smokeless / cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class NRT; model quitscore=NRT ;  
lsmeans NRT / cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class pill; model quitscore=pill ;  
lsmeans pill  / cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class quitline; model quitscore=quitline;  
lsmeans quitline/ cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class counsel; model quitscore=counsel;  
lsmeans counsel / cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class  classgr; model quitscore=classgr ;  
lsmeans classgr / cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 
PROC SURVEYREG data=daily1 VarMethod=BRR(Fay=0.5); 
class  webapp; model quitscore=webapp ;  
lsmeans webapp / cl diff;  
Weight PWSRWgt; RepWeights RepWgt1-RepWgt160;Run; 

/*End of paper code*/



